#ifndef _IMAGE_F32_H
#define _IMAGE_F32_H

#include <stdint.h>

typedef struct image_f32 image_f32_t;

struct image_f32
{
    int width, height;
    int stride; // in units of floats

    float *buf; // indexed as buf[y*stride + x]
};

#include "image_u8.h"
#include "image_u32.h"

image_f32_t *image_f32_create(int width, int height);
void image_f32_destroy(image_f32_t * fim);

// channel = [0,1,2,3] indicates which of the 4 bytes you want to extract into the target 't'
void image_f32_fill_channel_from_u32(image_f32_t * fim, const image_u32_t *im, int channel);
void image_f32_fill_gray_from_rgb_u32(image_f32_t *fim, const image_u32_t *im);
void image_f32_fill_from_u8(image_f32_t *fim, const image_u8_t *im);

#endif
